package e2q.liferay.domain;

import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
// default package



/**
 * E2qLiUsersUserGroupsId entity. @author MyEclipse Persistence Tools
 */

public class E2qLiUsersUserGroupsId  implements java.io.Serializable {


    // Fields    

     private E2qLiUserGroup userGroup;
     private E2qLiUser user;


    // Constructors

    /** default constructor */
    public E2qLiUsersUserGroupsId() {
    }

    
    /** full constructor */
    public E2qLiUsersUserGroupsId(E2qLiUserGroup userGroup, E2qLiUser user) {
        this.userGroup = userGroup;
        this.user = user;
    }

   
    // Property accessors
	@ManyToOne
	@JoinColumn(name = "userGroupId")
    public E2qLiUserGroup getUserGroup() {
        return this.userGroup;
    }
    
    public void setUserGroup(E2qLiUserGroup userGroup) {
        this.userGroup = userGroup;
    }
	@ManyToOne
	@JoinColumn(name = "userId")
    public E2qLiUser getUser() {
        return this.user;
    }
    
    public void setUser(E2qLiUser user) {
        this.user = user;
    }
   



   public boolean equals(Object other) {
         if ( (this == other ) ) return true;
		 if ( (other == null ) ) return false;
		 if ( !(other instanceof E2qLiUsersUserGroupsId) ) return false;
		 E2qLiUsersUserGroupsId castOther = ( E2qLiUsersUserGroupsId ) other; 
         
		 return ( (this.userGroup.getUserGroupId()==castOther.userGroup.getUserGroupId()) || ( this.userGroup.getUserGroupId()!=null && castOther.userGroup.getUserGroupId()!=null && this.userGroup.getUserGroupId().equals(castOther.userGroup.getUserGroupId()) ) )
 && ( (this.user.getUserId()==castOther.user.getUserId()) || ( this.user.getUserId()!=null && castOther.user.getUserId()!=null && this.user.getUserId().equals(castOther.user.getUserId()) ) );
   }
   
   public int hashCode() {
         int result = 17;
         
         result = 37 * result + ( this.userGroup.getUserGroupId() == null ? 0 : this.userGroup.getUserGroupId().hashCode() );
         result = 37 * result + ( this.user.getUserId() == null ? 0 : this.user.getUserId().hashCode() );
         return result;
   }   





}